(function () {

    "use strict";

    var api = {
        userInfoUrl: '/api/user/userInfo',
        userSummaryUrl: '/api/user/userSummary'
    };
    sm.controller('wx-center-index-controller', ['$scope', '$http', function ($scope, $http){

        $scope.userInfo = {};
        $scope.summary = {};

        $scope.getData = function () {
            $http.get(api.userInfoUrl).success(function (res) {
                if (res.state) {
                    $scope.userInfo = res.data;
                }
            });

            $http.get(api.userSummaryUrl).success(function (res) {
                if (res.state) {
                    $scope.summary = res.data;
                }
            });
        };

        $scope.getData();

        /*
        $scope.gotoFans = function () {
            location.href="/center/fans";
        };

        $scope.about = function () {
            location.href = '/about';
        };
        */

        $scope.cashout = function () {
            location.href = '/center/cash';
        };

        /*
        $scope.showBill = function () {
            location.href = '/center/bill';
        };
        */

        $scope.accountIndex = function () {
            location.href = '/center/accountIndex';
        }

    }]);
})();

